/*
 * @Author: wangmyng wangmyng@163.com
 * @Date: 2025-11-02 22:00:53
 * @LastEditors: wangmyng wangmyng@163.com
 * @LastEditTime: 2025-11-09 23:11:19
 */
import { useState, useRef, useCallback, useEffect } from "react";
import "./index.less";
import { fetchCurrentWarningList } from "@/api/hap";
import DashboardCard from "@/components/pc/DashboardCard";

interface TodayDutyCardProps {
  collapsed?: boolean;
}

interface WarningItem {
  incidentCategory: any;
  id: string;
  serial: number;
  incidentStatus: string;
  incidentAddress: string;
  receiveTime: string;
}

/**
 * 首页：今日值班
 */
const TodayDutyCard: React.FC<TodayDutyCardProps> = () => {
  const [warningList, setWarningList] = useState<WarningItem[]>([]);
  const [selectedValue, setSelectedValue] = useState<string>("值班1");

  useEffect(() => {
    loadWarningList();
  }, []);

  const loadWarningList = useCallback(async () => {
    const data = await fetchCurrentWarningList();
    setWarningList(data);
  }, []);

  const handleSelectionChange = (selectedValue: string) => {
    console.log("选中了:", selectedValue);
  };

  return (
    <div className={`today-duty-card`}>
      <DashboardCard titles={["今日值班", "车辆状态", "车辆审批"]}>
        <div className="content-container">
        </div>
        <div className="content-container">
          <div className="alerts-column">
            <div className="column-title">未排消息2</div>
          </div>
        </div>
        <div className="content-container">
          <div className="alerts-column">
            <div className="column-title">未排消息3</div>
          </div>
        </div>
      </DashboardCard>
    </div>
  );
};

export default TodayDutyCard;
